package org.iabako.shared.iservice.security;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.iabako.shared.entity.user.Enterprise;
import org.iabako.shared.entity.user.User;

/**
 * Created by jose on 24/09/14.
 */
public interface AuthenticateServiceAsync {

    void getAuthenticatedUser(AsyncCallback<User> async);

    void reloadAuthenticatedUser(AsyncCallback<User> async);

    void reloadEnterpriseCredit(AsyncCallback<User> async);

    void getParentEnterprise(AsyncCallback<Enterprise> async);

    public static final class Util {
        private static AuthenticateServiceAsync instance;

        public static final AuthenticateServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(AuthenticateService.class);
            }
            return instance;
        }
    }
}
